#include <stdio.h>
#include <string.h>

#define MAX_DIGITS 35

typedef struct bignum_t
{
    char str[MAX_DIGITS+1]; /* right-aligned string; e.g. "000123" */
    int  len;               /* number of decimal digits in the number */
} bignum_t;

static char *bignum_str(bignum_t *num)
{
    return num->str + MAX_DIGITS - num->len;
}

static void bignum_init(bignum_t *num, const char *s)
{
    num->len = (int)strlen(s);
    memset(num->str, '0', sizeof(num->str));
    strcpy(bignum_str(num), s);
}

static void bignum_add(bignum_t *dst, const bignum_t *src)
{
    int i, carry = 0;
    for (i = MAX_DIGITS - 1; i >= 0; i--)
    {
        int d = (int)(dst->str[i] - '0') + (int)(src->str[i] - '0') + carry;
        if (d >= 10)
        {
            d -= 10;
            carry = 1;
        }
        else
        {
            carry = 0;
        }
        dst->str[i] = d + '0';
    }
    for (i = 0; i < MAX_DIGITS - 1; i++)
    {
        if (dst->str[i] != '0')
            break;
    }
    dst->len = MAX_DIGITS - i;
}

int main()
{
    bignum_t a[3];
    char s[3][10];
    while (scanf("%s %s %s", s[0], s[1], s[2]) == 3)
    {
        int i;
        for (i = 0; i < 3; i++)
        {
            bignum_init(&a[i], s[i]);
        }
        for (i = 3; i <= 99; i++)
        {
            bignum_add(&a[i % 3], &a[(i+1) % 3]);
            bignum_add(&a[i % 3], &a[(i+2) % 3]);
        }
        printf("%s\n", bignum_str(&a[0]));
    }
    return 0;
}